package model

var RepositoryNames = struct { // repositories
	ForumUser           string
	ForumMedia          string
	ForumFeed           string
	ForumForum          string
	ForumTopic          string
	ForumPost           string
	ForumPoll           string
	ForumReactionLog    string
	ForumNotice         string
	ForumCollect        string
	ForumUserCollect    string
	ForumUserShowcase   string
	ForumTerm           string
	ForumComment        string
	ForumPerfumeCabinet string
	ForumCard           string
}{
	ForumUser:           "ForumUser",
	ForumMedia:          "ForumMedia",
	ForumFeed:           "ForumFeed",
	ForumForum:          "ForumForum",
	ForumTopic:          "ForumTopic",
	ForumPost:           "ForumPost",
	ForumPoll:           "ForumPoll",
	ForumReactionLog:    "ForumReactionLog",
	ForumNotice:         "ForumNotice",
	ForumCollect:        "ForumCollect",
	ForumUserCollect:    "ForumUserCollect",
	ForumUserShowcase:   "ForumUserShowcase",
	ForumTerm:           "ForumTerm",
	ForumComment:        "ForumComment",
	ForumPerfumeCabinet: "ForumPerfumeCabinet",
	ForumCard:           "ForumCard",
}

var RepositoryPreloadMap = map[string]map[string]string{
	RepositoryNames.ForumUser: {
		"Id":        ForumUserColumns.ID,
		"UserId":    ForumUserColumns.UserID,
		"Nickname":  ForumUserColumns.UserNickname,
		"Avatar":    ForumUserColumns.UserAvatar,
		"Status":    ForumUserColumns.UserStatus,
		"Signature": ForumUserColumns.Signature,
		"Email":     ForumUserColumns.UserEmail,
		"Url":       ForumUserColumns.UserURL,
		"CreatedBy": ForumUserColumns.CreatedBy,
		"CreatedAt": ForumUserColumns.CreatedAt,
		"UpdatedAt": ForumUserColumns.UpdatedAt,
		"DeletedAt": ForumUserColumns.DeletedAt,
	},
	RepositoryNames.ForumMedia: {
		"Uid":          ForumAttachmentRelationshipColumns.AttachmentRelationshipID,
		"Id":           ForumAttachmentRelationshipColumns.AttachmentID,
		"Uri":          ForumAttachmentRelationshipColumns.AttachmentSource,
		"Url":          ForumAttachmentRelationshipColumns.AttachmentImageURL,
		"Thumbnail":    ForumAttachmentRelationshipColumns.AttachmentThumbnail,
		"Order":        ForumAttachmentRelationshipColumns.AttachmentOrder,
		"altText":      ForumAttachmentRelationshipColumns.AttachmentImageAlt,
		"sourceUrl":    ForumAttachmentRelationshipColumns.AttachmentImageURL,
		"mediaDetails": ForumAttachmentRelationshipColumns.AttachmentImageMeta, // Deprecated
		"metaData":     ForumAttachmentRelationshipColumns.AttachmentImageMeta,
	},
	RepositoryNames.ForumFeed: {
		"Id":              ForumFeedColumns.ID,
		"ForumId":         ForumFeedColumns.ForumID,
		"TopicId":         ForumFeedColumns.TopicID,
		"PostId":          ForumFeedColumns.PostID,
		"AuthorId":        ForumFeedColumns.AuthorID,
		"AuthorNickname":  ForumFeedColumns.AuthorNickname,
		"AuthorAvatar":    ForumFeedColumns.AuthorAvatar,
		"AuthorIp":        ForumFeedColumns.AuthorIP,
		"AuthorRankId":    ForumFeedColumns.AuthorRankID,
		"AuthorRoleId":    ForumFeedColumns.AuthorRoleID,
		"AuthorAnonymous": ForumFeedColumns.AuthorAnonymous,
		"Excerpt":         ForumFeedColumns.Excerpt,
		"MediaId":         ForumFeedColumns.ThumbnailID,
		"MediaUrl":        ForumFeedColumns.ThumbnailURL,
		"Status":          ForumFeedColumns.Status,
		"Sticky":          ForumFeedColumns.Sticky,
		"CreatedAt":       ForumFeedColumns.CreatedAt,
		"UpdatedAt":       ForumFeedColumns.UpdatedAt,
		"LikeCount":       ForumFeedColumns.LikeCount,
		"ReplyCount":      ForumFeedColumns.ReplyCount,
	},
	RepositoryNames.ForumForum: {
		"Id": ForumForumColumns.ForumID,
	},
	RepositoryNames.ForumTopic: {
		"Id":           ForumTopicColumns.TopicID,
		"ForumId":      ForumTopicColumns.ForumID,
		"AuthorId":     ForumTopicColumns.TopicAuthorID,
		"AuthorName":   ForumTopicColumns.TopicAuthorNickname,
		"AuthorEmail":  ForumTopicColumns.TopicAuthorEmail,
		"AuthorAvatar": ForumTopicColumns.TopicAuthorAvatar,
		"AuthorIp":     ForumTopicColumns.TopicAuthorIP,
		"AuthorLevel":  ForumTopicColumns.TopicAuthorRankID,
		"AuthorRankId": ForumTopicColumns.TopicAuthorRankID,
		"AuthorRoleId": ForumTopicColumns.TopicAuthorRoleID,
		"Anonymous":    ForumTopicColumns.TopicAuthorAnonymous,
		"Title":        ForumTopicColumns.Title,
		"Slug":         ForumTopicColumns.Slug,
		"CreatedAt":    ForumTopicColumns.TopicDate,
		"UpdatedAt":    ForumTopicColumns.TopicModifiedDate,
		"Status":       ForumTopicColumns.TopicStatus,
		"Sort":         ForumTopicColumns.Sort,
		"Sticky":       ForumTopicColumns.Sticky,
		"PostCount":    ForumTopicColumns.PostCount,
		"ViewCount":    ForumTopicColumns.ViewCount,
		"CommentCount": ForumTopicColumns.CommentCount,
		"PhotoCount":   ForumTopicColumns.PhotoCount,
		"id":           ForumTopicColumns.TopicID,
	},
	RepositoryNames.ForumPost: {
		"Id":            ForumPostColumns.PostID,
		"AuthorId":      ForumPostColumns.PostAuthorID,
		"ForumId":       ForumPostColumns.ForumID,
		"TopicId":       ForumPostColumns.TopicID,
		"ParentId":      ForumPostColumns.ParentID,
		"AuthorName":    ForumPostColumns.PostAuthorNickname,
		"AuthorEmail":   ForumPostColumns.PostAuthorEmail,
		"AuthorAvatar":  ForumPostColumns.PostAuthorAvatar,
		"AuthorIp":      ForumPostColumns.PostAuthorIP,
		"AuthorRankId":  ForumPostColumns.PostAuthorRankID,
		"AuthorRoleId":  ForumPostColumns.PostAuthorRoleID,
		"Anonymous":     ForumPostColumns.PostAuthorAnonymous,
		"Title":         ForumPostColumns.PostTitle,
		"ContentHtml":   ForumPostColumns.PostContent,
		"Excerpt":       ForumPostColumns.PostExcerpt,
		"Status":        ForumPostColumns.PostStatus,
		"Sort":          ForumPostColumns.Sort,
		"Sticky":        ForumPostColumns.Sticky,
		"CommentStatus": ForumPostColumns.CommentStatus,
		"CommentCount":  ForumPostColumns.CommentCount,
		"PublicDate":    ForumPostColumns.PublicDate,
		"CreatedAt":     ForumPostColumns.PostDate,
		"UpdatedAt":     ForumPostColumns.PostModifiedDate,
		"PhotoCount":    ForumPostColumns.PhotoCount,
		"AverageRating": ForumPostColumns.AverageRating,
		"id":            ForumPostColumns.PostID,
	},
	RepositoryNames.ForumPoll: {
		"Id": ForumPollColumns.PollID,
	},
	RepositoryNames.ForumReactionLog: {
		"Id":         ForumReactionLogColumns.ID,
		"TopicId":    ForumReactionLogColumns.TopicID,
		"PostId":     ForumReactionLogColumns.PostID,
		"UserId":     ForumReactionLogColumns.UserID,
		"Type":       ForumReactionLogColumns.Type,
		"Status":     ForumReactionLogColumns.Status,
		"Count":      ForumReactionLogColumns.Count,
		"CreatedAt":  ForumReactionLogColumns.CreatedAt,
		"CreateDate": ForumReactionLogColumns.CreateDate,
	},
	RepositoryNames.ForumNotice: {
		"Id":        ForumUserNoticeColumns.NoticeID,
		"UserId":    ForumUserNoticeColumns.UserID,
		"ForumId":   ForumUserNoticeColumns.ForumID,
		"ParentId":  ForumUserNoticeColumns.ParentID,
		"TopicId":   ForumUserNoticeColumns.TopicID,
		"PostId":    ForumUserNoticeColumns.PostID,
		"CommentId": ForumUserNoticeColumns.CommentID,
		"Type":      ForumUserNoticeColumns.Type,
		"Avatar":    ForumUserNoticeColumns.Avatar,
		"Title":     ForumUserNoticeColumns.Title,
		"Desc":      ForumUserNoticeColumns.Title,
		"Extra":     ForumUserNoticeColumns.Description,
		"Status":    ForumUserNoticeColumns.Status,
		"ReadAt":    ForumUserNoticeColumns.ReadAt,
		"CreatedAt": ForumUserNoticeColumns.CreatedAt,
		"UpdatedAt": ForumUserNoticeColumns.UpdatedAt,
	},
	RepositoryNames.ForumCollect: {
		"Id":         ForumUserCollectColumns.CollectID,
		"UserId":     ForumUserCollectColumns.UserID,
		"PlatformId": ForumUserCollectColumns.PlatformID,
		"ObjectId":   ForumUserCollectColumns.ObjectID,
		"ObjectType": ForumUserCollectColumns.ObjectType,
		"Status":     ForumUserCollectColumns.Status,
		"CreatedAt":  ForumUserCollectColumns.CreatedAt,
		"UpdatedAt":  ForumUserCollectColumns.UpdatedAt,
	},
	RepositoryNames.ForumUserCollect: {
		"Id":         ForumUserCollectColumns.CollectID,
		"UserId":     ForumUserCollectColumns.UserID,
		"PlatformId": ForumUserCollectColumns.PlatformID,
		"ObjectId":   ForumUserCollectColumns.ObjectID,
		"ObjectType": ForumUserCollectColumns.ObjectType,
		"Status":     ForumUserCollectColumns.Status,
		"CreatedAt":  ForumUserCollectColumns.CreatedAt,
		"UpdatedAt":  ForumUserCollectColumns.UpdatedAt,
	},
	RepositoryNames.ForumUserShowcase: {
		"Id":          ForumUserShowcaseColumns.ShowcaseID,
		"UserId":      ForumUserShowcaseColumns.UserID,
		"PlatformId":  ForumUserShowcaseColumns.PlatformID,
		"Background":  ForumUserShowcaseColumns.Background,
		"Pattern":     ForumUserShowcaseColumns.Pattern,
		"Frame":       ForumUserShowcaseColumns.Frame,
		"Description": ForumUserShowcaseColumns.Description,
		"CreatedAt":   ForumUserShowcaseColumns.CreatedAt,
		"UpdatedAt":   ForumUserShowcaseColumns.UpdatedAt,
	},
	RepositoryNames.ForumTerm: {
		"Id":                  ForumTermColumns.TermID,
		"Name":                ForumTermColumns.Name,
		"Slug":                ForumTermColumns.Slug,
		"Taxonomy":            ForumTermColumns.Taxonomy,
		"ParentId":            ForumTermColumns.ParentID,
		"TermGroup":           ForumTermColumns.TermGroup,
		"Description":         ForumTermColumns.Description,
		"DescriptionFiltered": ForumTermColumns.DescriptionFiltered,
	},
	RepositoryNames.ForumComment: {
		"Id":             ForumCommentColumns.CommentID,
		"ForumId":        ForumCommentColumns.ForumID,
		"TopicId":        ForumCommentColumns.TopicID,
		"PostId":         ForumCommentColumns.PostID,
		"ParentId":       ForumCommentColumns.ParentID,
		"UserId":         ForumCommentColumns.CommentUserID,
		"NickName":       ForumCommentColumns.CommentUser,
		"UserEmail":      ForumCommentColumns.CommentUserEmail,
		"UserAvatar":     ForumCommentColumns.CommentUserURL,
		"Ip":             ForumCommentColumns.CommentUserIP,
		"AnonymousUser":  ForumCommentColumns.CommentUserAnonymous,
		"CommentContent": ForumCommentColumns.CommentContent,
		"CommentType":    ForumCommentColumns.CommentType,
		"CommentStatus":  ForumCommentColumns.CommentStatus,
		"CreatedAt":      ForumCommentColumns.CommentDate,
	},
	RepositoryNames.ForumPerfumeCabinet: {
		"Id":         ForumUserPerfumeCabinetColumns.ID,
		"UserId":     ForumUserPerfumeCabinetColumns.UserID,
		"PlatformId": ForumUserPerfumeCabinetColumns.PlatformID,
		"ObjectId":   ForumUserPerfumeCabinetColumns.ObjectID,
		"ObjectType": ForumUserPerfumeCabinetColumns.ObjectType,
		"Status":     ForumUserPerfumeCabinetColumns.Status,
		"CreatedAt":  ForumUserPerfumeCabinetColumns.CreatedAt,
		"UpdatedAt":  ForumUserPerfumeCabinetColumns.UpdatedAt,
	},
	RepositoryNames.ForumCard: {
		"Id":         ForumPostCardColumns.ID,
		"PostId":     ForumPostCardColumns.PostID,
		"ObjectId":   ForumPostCardColumns.ObjectID,
		"ObjectType": ForumPostCardColumns.ObjectType,
		"LinkUrl":    ForumPostCardColumns.LinkURL,
		"PicUrl":     ForumPostCardColumns.PicURL,
		"Title":      ForumPostCardColumns.Title,
		"Subtitle":   ForumPostCardColumns.Subtitle,
		"Label":      ForumPostCardColumns.Label,
		"Price":      ForumPostCardColumns.Price,
	},
}

var RpcEntityNames = struct { // rpc entities
	ForumUser           string
	ForumMedia          string
	ForumFeed           string
	ForumForum          string
	ForumTopic          string
	ForumTopicMeta      string
	ForumPost           string
	ForumPostMeta       string
	ForumPoll           string
	ForumMeta           string
	ForumReactionLog    string
	ForumNotice         string
	ForumCollect        string
	ForumUserCollect    string
	ForumUserShowcase   string
	ForumTerm           string
	ForumComment        string
	ForumCommentMeta    string
	ForumPerfumeCabinet string
	ForumCard           string
}{
	ForumUser:           "forumUser",
	ForumMedia:          "forumMedia",
	ForumFeed:           "forumFeed",
	ForumForum:          "forumForum",
	ForumTopic:          "forumTopic",
	ForumTopicMeta:      "forumTopicMeta",
	ForumPost:           "forumPost",
	ForumPostMeta:       "forumPostMeta",
	ForumPoll:           "forumPoll",
	ForumReactionLog:    "forumReactionLog",
	ForumNotice:         "forumNotice",
	ForumCollect:        "forumCollect",
	ForumUserCollect:    "forumUserCollect",
	ForumUserShowcase:   "forumUserShowcase",
	ForumTerm:           "forumTerm",
	ForumComment:        "forumComment",
	ForumCommentMeta:    "forumCommentMeta",
	ForumPerfumeCabinet: "forumPerfumeCabinet",
	ForumCard:           "forumCard",
}

type ColumnSetting struct {
	Name          string /// rpc column name
	RpcEntityName string /// sqlboiler repository name
}

var RpcEntityPreloadMap = map[string]map[string]*ColumnSetting{
	RpcEntityNames.ForumUser:  {},
	RpcEntityNames.ForumMedia: {},
	RpcEntityNames.ForumFeed:  {},
	RpcEntityNames.ForumForum: {
		"Topic": &ColumnSetting{
			Name:          "Topic",
			RpcEntityName: RpcEntityNames.ForumTopic,
		},
		"Poll": &ColumnSetting{
			Name:          "Poll",
			RpcEntityName: RpcEntityNames.ForumPoll,
		},
	},
	RpcEntityNames.ForumTopic: {
		"Post": &ColumnSetting{
			Name:          "Post",
			RpcEntityName: RpcEntityNames.ForumPost,
		},
		"User": &ColumnSetting{
			Name:          "User",
			RpcEntityName: RpcEntityNames.ForumUser,
		},
	},
	RpcEntityNames.ForumTopicMeta: {
		"fullHead": &ColumnSetting{
			Name: "fullHead",
		},
		"title": &ColumnSetting{
			Name: "title",
		},
		"metaDesc": &ColumnSetting{
			Name: "metaDesc",
		},
		"replyCount": &ColumnSetting{
			Name: "_reply_count",
		},
	},
	RpcEntityNames.ForumPost: {
		"Topic": &ColumnSetting{
			Name:          "Topic",
			RpcEntityName: RpcEntityNames.ForumTopic,
		},
		"Media": &ColumnSetting{
			Name:          "Media",
			RpcEntityName: RpcEntityNames.ForumMedia,
		},
		"Meta": &ColumnSetting{
			Name:          "Meta",
			RpcEntityName: RpcEntityNames.ForumPostMeta,
		},
		"User": &ColumnSetting{
			Name:          "User",
			RpcEntityName: RpcEntityNames.ForumUser,
		},
		"Card": &ColumnSetting{
			Name:          "Card",
			RpcEntityName: RpcEntityNames.ForumCard,
		},
		"Term": &ColumnSetting{
			Name:          "Term",
			RpcEntityName: RpcEntityNames.ForumTerm,
		},
	},
	RpcEntityNames.ForumPostMeta: {
		"season": &ColumnSetting{
			Name: "season",
		},
		"note": &ColumnSetting{
			Name: "_note",
		},
		"grade": &ColumnSetting{
			Name: "_grade",
		},
		"upvoteCount": &ColumnSetting{
			Name: "_upvote_count",
		},
		"likeCount": &ColumnSetting{
			Name: "_like_count",
		},
		"collectCount": &ColumnSetting{
			Name: "_collect_count",
		},
		"mediaId": &ColumnSetting{ // ##24.12.23##
			Name: "_thumbnail_id",
		},
		"mediaUrl": &ColumnSetting{ // ##24.12.23##
			Name: "_thumbnail_url",
		},
		"viewCount": &ColumnSetting{ // ##24.12.24##
			Name: "_view_count",
		},
		"commentCount": &ColumnSetting{ // ##24.12.24##
			Name: "_comment_count",
		},
		"forwardCount": &ColumnSetting{ // ##24.12.24##
			Name: "_forward_count",
		},
	},
	RpcEntityNames.ForumPoll:         {},
	RpcEntityNames.ForumReactionLog:  {},
	RpcEntityNames.ForumNotice:       {},
	RpcEntityNames.ForumCollect:      {},
	RpcEntityNames.ForumUserCollect:  {},
	RpcEntityNames.ForumUserShowcase: {},
	RpcEntityNames.ForumTerm: {
		"Media": &ColumnSetting{
			Name:          "Media",
			RpcEntityName: RpcEntityNames.ForumMedia,
		},
		"Meta": &ColumnSetting{
			Name:          "Meta",
			RpcEntityName: RpcEntityNames.ForumPostMeta,
		},
	},
	RpcEntityNames.ForumComment: {
		"Meta": &ColumnSetting{
			Name:          "Meta",
			RpcEntityName: RpcEntityNames.ForumCommentMeta,
		},
	},
	RpcEntityNames.ForumCommentMeta:    {},
	RpcEntityNames.ForumPerfumeCabinet: {},
	RpcEntityNames.ForumCard:           {},
}
